﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
	mc:Ignorable="d"
	x:Class="Edutainment.BubbleSortWindow"
	x:Name="UserControl" Height="375" Width="900">
    
    <UserControl.Resources>
        <Style x:Key="btn_tpl_subnavi" TargetType="{x:Type ToggleButton}">
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                        <Grid>
                            <!--RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"-->
                            <ContentPresenter x:Name="contentPresenter" />
                        </Grid>
                        <ControlTemplate.Triggers>
                            <!--<Trigger Property="IsFocused" Value="True">
                                <Setter Property="OpacityMask" TargetName="contentPresenter" Value="White"/>
                                <Setter Property="Focusable" TargetName="contentPresenter" Value="False"/>
                                <Setter Property="IsEnabled" TargetName="contentPresenter" Value="False"/>
                            </Trigger>-->
                            <Trigger Property="IsChecked" Value="True">
                                <Setter Property="Foreground" Value="#FF8B0000"/> 
                            </Trigger>
                            <Trigger Property="IsChecked" Value="False">
                                <Setter Property="Foreground" Value="#FF0E3E67"/>
                            </Trigger>
                            <!--<Trigger Property="IsDefaulted" Value="True">
                                <Setter Property="OpacityMask" TargetName="contentPresenter" Value="White"/>
                            </Trigger>-->
                            <!--<Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="OpacityMask" TargetName="contentPresenter" Value="#7FFFFFFF"/>
                            </Trigger>-->
                            <!--<Trigger Property="IsPressed" Value="True">
                                <Setter Property="OpacityMask" TargetName="contentPresenter" Value="#FF0E3E67"/>
                            </Trigger>-->
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="OpacityMask" TargetName="contentPresenter" Value="White"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="FontSize" Value="18.667"/>
            <!--<Setter Property="Foreground" Value="#FF0E3E67"/>-->
        </Style>
        <Storyboard x:Key="Storyboard1" RepeatBehavior="Forever"/>
    	<Style x:Key="ButtonFocusVisual">
    		<Setter Property="Control.Template">
    			<Setter.Value>
    				<ControlTemplate>
    					<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
    		<GradientStop Color="#F3F3F3" Offset="0"/>
    		<GradientStop Color="#EBEBEB" Offset="0.5"/>
    		<GradientStop Color="#DDDDDD" Offset="0.5"/>
    		<GradientStop Color="#CDCDCD" Offset="1"/>
    	</LinearGradientBrush>
    	<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>

    	<Style x:Key="PlayButton" TargetType="{x:Type Button}">
    		<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
    		<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
    		<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
    		<Setter Property="BorderThickness" Value="1"/>
    		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    		<Setter Property="HorizontalContentAlignment" Value="Center"/>
    		<Setter Property="VerticalContentAlignment" Value="Center"/>
    		<Setter Property="Padding" Value="1"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type Button}">
    					<ControlTemplate.Triggers>
    						<Trigger Property="IsKeyboardFocused" Value="true"/>
    						<Trigger Property="ToggleButton.IsChecked" Value="true"/>
    						<Trigger Property="IsEnabled" Value="false">
    							<Setter Property="Foreground" Value="#ADADAD"/>
    						</Trigger>
    					</ControlTemplate.Triggers>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Style x:Key="pauseButton" TargetType="{x:Type Button}">
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type Button}">
    					<Grid>
    						<Rectangle Fill="#7F000000" Stroke="{x:Null}"/>
    						<Rectangle Fill="#7FFFFFFF" HorizontalAlignment="Left" Margin="25,9,0,9" Stroke="{x:Null}" Width="10"/>
    						<Rectangle Fill="#7FFFFFFF" HorizontalAlignment="Right" Margin="0,9,26,9" Stroke="{x:Null}" Width="10"/>
    					</Grid>
    					<ControlTemplate.Triggers>
    						<Trigger Property="IsFocused" Value="True"/>
    						<Trigger Property="IsDefaulted" Value="True"/>
    						<Trigger Property="IsMouseOver" Value="True"/>
    						<Trigger Property="IsPressed" Value="True"/>
    						<Trigger Property="IsEnabled" Value="False"/>
    					</ControlTemplate.Triggers>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Style x:Key="playButton" TargetType="{x:Type Button}">
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type Button}">
    					<Grid>
    						<Rectangle Fill="#7F000000" Stroke="{x:Null}"/>
    						<Path Data="M154,47 L154,69 177,57 z" Fill="#7FFFFFFF" Margin="29,15,27,14" Stretch="Fill" Stroke="{x:Null}"/>
    					</Grid>
    					<ControlTemplate.Triggers>
    						<Trigger Property="IsFocused" Value="True"/>
    						<Trigger Property="IsDefaulted" Value="True"/>
    						<Trigger Property="IsMouseOver" Value="True"/>
    						<Trigger Property="IsPressed" Value="True"/>
    						<Trigger Property="IsEnabled" Value="False"/>
    					</ControlTemplate.Triggers>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Style x:Key="videoButton" TargetType="{x:Type Button}">
    		<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
    		<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
    		<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
    		<Setter Property="BorderThickness" Value="1"/>
    		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    		<Setter Property="HorizontalContentAlignment" Value="Center"/>
    		<Setter Property="VerticalContentAlignment" Value="Center"/>
    		<Setter Property="Padding" Value="1"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type Button}">
    					<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true" RoundCorners="False">
    						<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content=""/>
    					</Microsoft_Windows_Themes:ButtonChrome>
    					<ControlTemplate.Triggers>
    						<Trigger Property="IsKeyboardFocused" Value="true">
    							<Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
    						</Trigger>
    						<Trigger Property="ToggleButton.IsChecked" Value="true">
    							<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
    						</Trigger>
    						<Trigger Property="IsEnabled" Value="false">
    							<Setter Property="Foreground" Value="#ADADAD"/>
    						</Trigger>
    					</ControlTemplate.Triggers>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>

    </UserControl.Resources>
	<UserControl.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<BeginStoryboard Storyboard="{StaticResource Storyboard1}"/>
		</EventTrigger>
	</UserControl.Triggers>
    <Grid x:Name="bubbleSort" Grid.ColumnSpan="7" Grid.RowSpan="2" Visibility="Visible" Margin="0">
        <Grid.RowDefinitions>
            <RowDefinition Height="782.02275"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="521"/>
            <ColumnDefinition Width="31"/>
            <ColumnDefinition Width="259"/>
            <ColumnDefinition Width="133"/>
        </Grid.ColumnDefinitions>
        <Grid x:Name="mainContent" Grid.ColumnSpan="4" Height="273.677" Margin="8,55,52,0" VerticalAlignment="Top">
        
        	<Grid x:Name="overview" RenderTransformOrigin="0.5,0.5" Height="273.677" VerticalAlignment="Top" Margin="-2,-10,2,0">
        		<Grid.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform/>
        				<SkewTransform/>
        				<RotateTransform/>
        				<TranslateTransform/>
        			</TransformGroup>
        		</Grid.RenderTransform>
        		<TextBlock Margin="0,6.769,346.247,0" TextWrapping="Wrap" VerticalAlignment="Top" Foreground="White" FontSize="24" FontFamily="Segoe UI Light" Opacity="0.8" Height="29.354" HorizontalAlignment="Right" Width="95.091"><Run Language="de-de" Text="Erklärung"/></TextBlock>
        		<TextBlock Margin="443.662,48.273,5.338,-5.323" TextWrapping="Wrap" Foreground="White" FontSize="14.667" FontFamily="Segoe UI Light" Width="435" Opacity="0.8"><Run Foreground="#FFFD9D4C" FontFamily="Segoe UI" Text="Bubblesort "/><Run Text="(auch Sortieren durch Aufsteigen) ist ein Algorithmus der vergleichsbasiert eine Liste von Elementen sortiert. Dieses Sortierverfahren arbeitet in-place, sortiert stabil und hat eine Laufzeit von  im schlimmsten (Worst-Case) und im durchschnittlichen Fall (Average-Case). Damit ist die Laufzeit asymptotisch suboptimal. In der Praxis wird Bubblesort kaum eingesetzt, da andere Verfahren ein besseres Laufzeitverhalten haben. Der Algorithmus spielt allerdings in der Lehre eine Rolle, da er als einfach zu erklären bzw. zu demonstrieren gilt. Des Weiteren eignet sich der Algorithmus um Techniken wie schrittweise Optimierungen, Laufzeit- bzw. Komplexitäts- und Korrektheitsanalyse einzuführen."/></TextBlock>
        		<MediaElement x:Name="video" Margin="14,0,0,15.808" Source="video.mp4" HorizontalAlignment="Left" Width="405.317" LoadedBehavior="Manual" ScrubbingEnabled="True" Volume="1" UnloadedBehavior="Pause" MediaOpened="mediaDidLoad" />
        		
				<Image Height="18.467" Margin="0,-0.231,21.338,0" Source="images/print.png" Stretch="Fill" VerticalAlignment="Top" HorizontalAlignment="Right" Width="20.083" RenderTransformOrigin="0.344,0.506"/>
                <Button x:Name="playPauseButton" Margin="14,0,0,15.808" HorizontalAlignment="Left" Width="405.317" Click="btn_play_Click" Opacity="0" BorderThickness="0" />
                <Button x:Name="btn_play" Content="Button" HorizontalAlignment="Left" Margin="177.158,104,0,118.677" Style="{DynamicResource playButton}" Width="79" DataContext="{Binding Play, ElementName=video, Mode=OneWay}" IsHitTestVisible="False"/>
        		<Button x:Name="btn_pause" Content="Button" HorizontalAlignment="Left" Margin="162,104,0,118.677" Style="{DynamicResource pauseButton}" Width="79" Visibility="Hidden"/>
        		<TextBlock x:Name="txtBlock_duration" Margin="16,0,433,11.869" TextWrapping="Wrap" Foreground="White" FontSize="14.667" FontFamily="Segoe UI Light" Width="435" Opacity="0.6" Height="16.131" VerticalAlignment="Bottom" d:LayoutOverrides="HorizontalAlignment"><Run Language="de-de"/></TextBlock>
        	</Grid>
        </Grid>
        <ToggleButton x:Name="btn_overview" Content="Übersicht" HorizontalAlignment="Left" Height="21" Margin="19,18,0,0" Style="{DynamicResource btn_tpl_subnavi}" VerticalAlignment="Top" Width="94" Background="{x:Null}" BorderBrush="{x:Null}" Click="btn_Overview" Cursor="Hand" Opacity="0.8"/>
        <ToggleButton x:Name="btn_exercises" Content="Exercises" HorizontalAlignment="Left" Height="20.667" Margin="142.333,18,0,0" Style="{DynamicResource btn_tpl_subnavi}" VerticalAlignment="Top" Width="84.667" Background="{x:Null}" BorderBrush="{x:Null}" Click="btn_exercises_Click_1" Cursor="Hand" Opacity="0.8"/>
        <ToggleButton x:Name="btn_exams" Content="Exams" Height="20.667" Margin="0,18,165.914,0" VerticalAlignment="Top" Background="{x:Null}" BorderBrush="{x:Null}" Style="{DynamicResource btn_tpl_subnavi}" Cursor="Hand" HorizontalAlignment="Right" Width="89.333" Opacity="0.8" Click="btn_exams_Click_1"/>
        <Canvas HorizontalAlignment="Left" Height="100" Margin="-105,302,0,0" VerticalAlignment="Top" Width="100"/>
    </Grid>
</UserControl>